package com.gxa.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxa.modules.sys.entity.Area;
import com.gxa.modules.sys.mapper.AreaMapper;
import com.gxa.modules.sys.service.AreaService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements AreaService {

    @Override
    public
    List<Area> queryAll(Map<String,Object> params) {
        String id = (String) params.get("id");
        List<Area> areas = baseMapper.selectList(new QueryWrapper<Area>()
                .eq(StringUtils.isNotEmpty(id),"id",id));
        return areas;

    }

    @Override
    public
    void updateArea(Area area) {
        baseMapper.updateById(area);
    }

}
